{

    const _constructor = function () {
        return {
            data: {
                name : 'radio',
                title: '单选框', 
                selected : 0,
                items : [{  
                    text : 'Option'
                },{  
                    text : 'Option'
                },{  
                    text : 'Option'
                }]
            },

            methods: { 
                getValue : function () {
                    return this.selected;
                },
                
                getField : function () {
                    return this.name;
                }
            }
        }
    }

    const radio = {  
        elementTemplate : `
                    <div class="form-group">
                        <label>{{title}}</label>     
                        <form action="" method="get">
                           <label v-for="(item, index) in items" ><input :name="name" type="radio" :value="index" v-model="selected" />{{item.text}} </label>
                        </form>
                    </div>
        `,
        prototypeTemplate : `
                    <div class="form-group">
                        <label >请输入字段名(唯一):</label>
                        <input type="text" class="form-control input-sm" v-model="name">
                    </div>

					<div class="form-group">
					    <label >单选框的标题:</label>
					    <input type="text" class="form-control input-sm" v-model="title">
					</div>

					<a class="btn btn-default btn-xs" href="javascript:void('');" role="button" v-on:click="items.push({checked:false,text:'new Option'})">Add</a>

					<div class="form-inline" v-for="(item, index) in items" >
					    <div class="form-group col-md-12" >   
					        <div class="input-group col-md-10" style="margin-top:5px; ">
					          <input type="text" class="form-control input-sm" v-model="item.text">
					          <span class="input-group-btn">
					            <button type="button" class="close" aria-label="Close" v-on:click="items.splice(index, 1)"><span aria-hidden="true">&times;</span></button>
					          </span>
					        </div>
					    </div>
					</div>
        `,
        _constructor : _constructor 
    }


    if ( window.TEMPLATE && !window.TEMPLATE.radio ) {
        window.TEMPLATE.radio = radio
    }
}